<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core">
<head>
<title>IGNORED</title>
</head>
<body>
	<ui:composition template="/WEB-INF/layouts/base-layout.xhtml">
		<ui:define name="windowTitle">
			Add Employee
		</ui:define>

		<ui:define name="content">

			<h:form id="empForm">
				<h:panelGrid columns="3"
					columnClasses="labelCol, componenetCol, errorMsgCol" border="1"
					style="width:900px">
					<p:outputLabel for="emp_name" value="Employee Name" />
					<p:inputText id="emp_name"
						value="#{employeeBean.employee.employeeName}" required="true" >
						<f:validateLength maximum="200" />
					</p:inputText>	
					<p:message for="emp_name" display="text" />

					<p:outputLabel for="qualification" value="Qualification" />
					<p:inputText id="qualification"
						value="#{employeeBean.employee.qualification}" />
					<p:message for="qualification" display="text" />

					<p:outputLabel for="specialization" value="Specialization" />
					<p:inputText id="specialization"
						value="#{employeeBean.employee.specialization}" />
					<p:message for="specialization" display="text" />

					<p:outputLabel for="designation" value="Designation"/>
					<p:selectOneMenu id="designation" value="#{employeeBean.employee.designation}" converter="enumerationConverter">
						<f:selectItems var="d" value="#{employeeBean.designations}" itemLabel="#{d.enumValue}" itemValue="#{d}"/>
					</p:selectOneMenu>
					<p:message for="designation" display="text" />
					
					<p:outputLabel for="phone" value="Phone No." />
					<p:inputText id="phone"
						value="#{employeeBean.employee.phoneNumber}" />
					<p:message for="phone" display="text" />

					<p:outputLabel for="mobile" value="Mobile No." />
					<p:inputText id="mobile"
						value="#{employeeBean.employee.mobileNumber}" />
					<p:message for="mobile" display="text" />

					<p:outputLabel for="email" value="Email Id." />
					<p:inputText id="email"
						value="#{employeeBean.employee.email}" />
					<p:message for="email" display="text" />
					
					<p:spacer width="10" height="10" />
					<h:panelGroup>
						<p:commandButton value="Reset" update="empForm" actionListener="#{employeeBean.resetEmployeeForm()}"/>
						<p:commandButton value="Save" update="empForm" actionListener="#{employeeBean.saveEmployee()}"/>
					</h:panelGroup>
					<p:spacer width="10" height="10" />

				</h:panelGrid>
			</h:form>


		</ui:define>
	</ui:composition>
</body>
</html>